var sqlMap = {
    plane: {
        get: 'select * from plane where is_del=0 limit ? , 10',
        search: 'select * from plane where plane_id= ?',
        add: 'insert into plane set ?',
        update: 'update plane set ? where plane_id = ?',
        count: 'select count(*) from plane where is_del=0',
        searchCount: 'select count(*) from plane where is_del=0 and plane_type=?',
        searchList: 'select * from plane where is_del=0 and plane_type=? limit ? , 10'
    },
    flight: {
        get: 'select * from flight where is_del=0 limit ? , 10',
        search: ' select * from flight where flight_id = ?',
        add: 'insert into flight set ?',
        update: 'update flight set ? where flight_id = ?',
        count: 'select count(*) from flight where is_del=0',
        searchCount: 'select count(*) from flight where is_del=0 and plane_id=?',
        searchList:'select * from flight where is_del=0 and plane_id=? limit ? , 10'
    },
    order: {
        get: 'select * from orders limit ? , 10',
        add: 'insert into orders set ?',
        update: 'update orders set ? where order_id = ?',
        count: 'select count(*) from orders',
        delOrder: ' update flight set touristClassRemain=touristClassRemain + ?,businessClassRemain=businessClassRemain + ?,firstClassRemain=firstClassRemain + ? where flight_id = ?',
        addOrder: ' update flight set touristClassRemain=touristClassRemain - ?,businessClassRemain=businessClassRemain - ?,firstClassRemain=firstClassRemain - ? where flight_id = ?',
        statistic: 'select flight_id,sum(touristClassNum) as touristSum,sum(businessClassNum) as businessSum,sum(firstClassNum) as firstSum from orders group by flight_id',
        searchCount: 'select count(*) from orders where ',
        searchList: 'select * from orders where ',
        limit:' limit ? , 10'
    },
    ticket: {
        get: 'select * from ticket limit ? , 10',
        add: 'insert into ticket set ?',
        count: 'select count(*) from ticket',
        update: 'update ticket set ? where ticket_id = ?',
        searchCount: 'select count(*) from ticket where ',
        searchList: 'select * from ticket where ',
        delOrder:'update ticket set ? where order_id = ?',
        limit:' limit ? , 10'
    },
    fare: {
        get: 'select * from fare',
        update: 'update fare set ? where fare_id = ?'
    },
    admin: {
        add: 'insert into admin set ?',
        update: 'update admin set ? where admin_id = ?',
        get: 'select * from admin where is_del=0'
    },
    user: {
        add: 'insert into user set ?',
        update: 'update user set ? where user_id = ?',
        get: 'select * from user where is_del=0 limit ? , 10',
        count: 'select count(*) from user where is_del=0',
        searchCount:'select count(*) from user where is_del=0 and user_type=?',
        searchList:'select * from user where is_del=0 and user_type=? limit ? , 10',
        getFlight: 'select * from flight where is_del=0',
        login: 'select * from user where is_del=0'
    }
}
module.exports = sqlMap;